<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // const { uname, age } = { uname: '小王', age: 18 }
    // console.log(uname);
    // console.log(age);


    const pig = { name: '佩奇', age: 6 }
    // const { name, age } = pig
    // console.log(name);
    // console.log(age);
    const { name: uname, age } = pig
    console.log(uname);

    const goods = [{
      goodsName: '小米',
      price: 1999
    }]
    const [{ goodsName, price }] = goods
    console.log(goodsName);
    console.log(price);
  </script>
</body>

</html>